package com.secondHandPlatform.mapper;

import com.secondHandPlatform.entity.Focus;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author team
 * @since 2023-05-18
 */
public interface FocusMapper extends BaseMapper<Focus> {

    @Select("SELECT * FROM focus f join goods g join image i on f.goods_id = g.id and i.goods_id = g.id where f.user_id = #{userId}")
    List<Map<String, Object>> selectFocusByUser(@Param("userId")int userId);

}
